/**
 * 报表设计公司(2011)
 */
package com.reportgear.designer.pane.style;

import java.awt.BorderLayout;

import javax.swing.JTabbedPane;

import net.abbp.report.view.GridView;

import com.reportgear.core.swing.pane.base.JBaseDialog;
import com.reportgear.designer.style.pane.FormatPane;

/**
 * @version 1.0 2011-3-24
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since ANNCSR 2.0
 */
public class GlobalStyleDialog extends JBaseDialog implements ICellStyle {
    // 格式

    // private FormatPane formatPane;
    // 对齐
    private AlignPane alignPane;
    // 字体
    private ReportFontPane reportFontPane;

    // 边框
    private BorderStylePane borderStylePane;

    // 背景颜色
    // private BackgroundPane backgroundPane;

    public GlobalStyleDialog() {
        super();
        setTitle("全局样式");
        setSize(600, 400);

        initComponents();
    }

    public void populateCellStyle(GridView workSheet) {
        // formatPane.populateCellStyle(workSheet);
        alignPane.populateCellStyle(workSheet);
        reportFontPane.populateCellStyle(workSheet);
        borderStylePane.populateCellStyle(workSheet);
    }

    public void updateCellStyle(GridView workSheet) {
        // formatPane.updateCellStyle(workSheet);
        alignPane.updateCellStyle(workSheet);
        reportFontPane.updateCellStyle(workSheet);
        borderStylePane.updateCellStyle(workSheet);
    }

    private void initComponents() {
        JTabbedPane tabbedPane = new JTabbedPane();
        this.add(tabbedPane, BorderLayout.CENTER);

        // formatPane = new FormatPane();
        alignPane = new AlignPane();
        reportFontPane = new ReportFontPane();
        borderStylePane = new BorderStylePane();
        // backgroundPane = new BackgroundPane();

        // tabbedPane.add("格式", formatPane);
        tabbedPane.add("对齐", alignPane);
        tabbedPane.add("字体", reportFontPane);
        tabbedPane.add("边框", borderStylePane);
        // tabbedPane.add("背景", backgroundPane);
    }

    public static void main(String[] args) {
        GlobalStyleDialog dlg = new GlobalStyleDialog();
        dlg.showModel();
    }
}
